package momo;

import java.awt.event.ActionEvent;
import java.awt.event.KeyEvent;

import javax.swing.AbstractAction;
import javax.swing.Action;

import ch.unisi.inf.viewer.MainImgViewerPanel;


/**
 * 
 * @author Mohamed.Mosa@lu.unisi.ch
 * This mail action class is responsible for running my mail gui when the mail 
 * button is clicked  
 */

public final class MailAction extends AbstractAction{

	private final MainImgViewerPanel thumbPanel;

	public MailAction(MainImgViewerPanel thumbPanel){
		this.thumbPanel = thumbPanel;
		putValue(Action.NAME, "Mail");
		putValue(Action.MNEMONIC_KEY, KeyEvent.VK_E);
		putValue(Action.SHORT_DESCRIPTION, "Share this photo");
	}

	public final void actionPerformed(ActionEvent ev) {
		System.out.println("Share: "+ thumbPanel);

		MailGui runGui = new MailGui(thumbPanel.getSelectedImage());
	}
}